package com.realdtech.wechat.task.Service;

import com.realdtech.wechat.task.model.UserJoin;
import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2017/9/18.
 */
public class UserJoinService {

    private static final UserJoin dao=new UserJoin().dao();

    /**
     *  保存用户申请加盟信息
     * @param applyName     名字
     * @param applyTel      电话
     * @param applyAddress  地区
     * @param applyRemarks  备注
     */
    public void add(String applyName,String applyTel,String applyAddress,String applyRemarks){

        UserJoin join=new UserJoin();
        join.setName(applyName);
        join.setPhone(applyTel);
        join.setRegion(applyAddress);
        join.setRemark(applyRemarks);
        join.setDate(new Date());//创建时间
        join.save();
    }

    /**
     * 查询user_join数据库
     * @return
     */
    public List<UserJoin> findJoin(){

        return dao.find("SELECT * FROM user_join  order by id desc");
    }
}
